<template>
  <div id="selectById">
    <el-form :inline="true" class="demo-form-inline center" >
      <el-row :gutter="18">
        <el-col :span="3"><el-button icon="el-icon-refresh" type="success" plain onclick="history.go(-1)">返回</el-button></el-col>
      </el-row>
    </el-form>
    <el-form :inline="true" :model="form"  class="demo-from-inline" >
      <router-link>返回<i class="el-icon-thumb"></i></router-link>
      <!-- 商户名 -->
      <el-form-item label="商户名">
        <el-input type="text" :value="form.merchantName" readonly></el-input>
      </el-form-item>
    <br>
      <!-- 身份证号码 -->
      <el-form-item label="身份证号码">
        <el-input type="text" :value="form.idCard" readonly></el-input>
      </el-form-item>
      <br>
      <!-- 营业状态 -->
      <el-form-item label="营业状态">
        <el-input type="text" :value="form.onOff === 1 ? '营业' : '歇业'" readonly></el-input>
      </el-form-item>
      <br>
      <!-- 手机号码 -->
      <el-form-item label="手机号码">
        <el-input type="text" :value="form.merchantNumber" readonly></el-input>
      </el-form-item>
      <br>
      <!-- 营业执照图片 -->
      <el-form-item label="营业执照图片">
        <img :src="form.merchantImage" v-if="form.merchantImage" width="50%">
        <!-- 这里可以设置一个默认图片，当商户未上传图片时显示 -->
        <img src="" v-else width="50%">
      </el-form-item>
      <br>
      <!-- 审核意见 -->
      <el-form-item label="审核意见">
        <el-input type="text" :value="form.auditOpinion" readonly></el-input>
      </el-form-item>
      <br>
      <!-- 地址 -->
      <el-form-item label="地址">
        <el-input type="text" :value="form.merchantAddr" readonly></el-input>
      </el-form-item>
      <br>
      <!-- 审核时间 -->
      <el-form-item label="审核时间">
        <el-input type="text" :value="form.checkerTime" readonly></el-input>
      </el-form-item>
      <br>
      <!-- 负责人 -->
      <el-form-item label="负责人">
        <el-input type="text" :value="form.merchantPerson" readonly></el-input>
      </el-form-item>
      <br>
      <el-form-item label="审核状态">
        <el-input type="text" :value="form.userMerchantTag=='0'?'等待审核':(form.userMerchantTag=='3'?'审核未通过':'审核通过')" readonly></el-input>
      </el-form-item>
    </el-form>
    <br>
  </div>
</template>

<script>
export default  {
  created() {
    this.get()
  },
  methods:{
    async get(){
      const {data : res}  = await this.$http.post(`/merchant/selectById?id=`+this.$route.query.index)
      console.log(res)
      this.form = res
    }
  },
  data() {
    return {
      form:{

      }
    }
  }
}
</script>

<style scoped>

</style>